import request from '@/utils/request'

//添加角色
export function addrole(data) {
    return request({
        url: 'admin/role/addrole',
        method: 'post',
        data
    })
}

//修改角色
export function updateRole(data) {
    return request({
        url: 'admin/role/updateRole',
        method: 'post',
        data
    })
}


//删除角色
export function deleteRoleById(id) {
    return request({
        url: 'admin/role/deleteRoleById',
        method: 'GET',
        params: id
    })
}

//返回所有角色
export function getRoleList(data) {
    return request({
        url: 'admin/role/getRoleList',
        method: 'post',
        data
    })
}

//给角色添加菜单
export function roleAddMenu(data) {
    return request({
        url: 'admin/role/roleAddMenu',
        method: 'post',
        data
    })
}

//给角色删除菜单
export function roleDeleteMenu(data) {
    return request({
        url: 'admin/role/roleDeleteMenu',
        method: 'post',
        data
    })
}

//查看该角色的菜单
export function getRoleMenuIdList(role_id) {
    return request({
        url: 'admin/role/getRoleMenuIdList',
        method: 'GET',
        params: role_id
    })
}

export function getAllmenu(data) {
    return request({
        url: 'admin/menu/getAllmenu',
        method: 'get',
        data
    })
}